package string;

//hasNextXxx()方法
import java.util.Scanner;

public class Demo1_Scanner {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //int i = sc.nextInt();//键盘录入整数
        //System.out.println(i);

        if(sc.hasNextInt()) {//hasNextInt()方法用来判断输入的是不是整数
            int i = sc.nextInt();
            System.out.println(i);
        }else {
            System.out.println("输入类型错误");
        }
        sc.close();
    }
}
